package com.hhit.zhgd.service.impl

import com.hhit.zhgd.domain.entity.ZhgdMachineryInfo
import com.hhit.zhgd.service.ZhgdMachineryInfoService
import jakarta.annotation.Resource
import org.junit.jupiter.api.Test

import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
internal class ZhgdMachineryInfoServiceImplTest {
    @Resource
    private var zhgdMachineryInfoService: ZhgdMachineryInfoService? = null

    @Test
    fun addMachineryInfo() {
        zhgdMachineryInfoService?.addMachineryInfo(
            zhgdMachineryInfo = ZhgdMachineryInfo(
                name = "test",
                type = "test",
                amount = 1,
                machineNumber = "test",
                testStartTime = "2024-07-07",
                testEndTime = "2024-07-09",
                testPlanEndTime = "2024-07-09"
            )
        )
    }

    @Test
    fun getMachineryInfoByName() {
        zhgdMachineryInfoService?.getMachineryInfoByName()?.forEach { println(it) }
    }

    @Test
    fun updateMachineryInfo() {
        zhgdMachineryInfoService?.updateMachineryInfo(zhgdMachineryInfo = ZhgdMachineryInfo(
            name = "test11",
            type = "test11",
            amount = 3,
            machineNumber = "test11",
            testStartTime = "2024-07-07",
            testEndTime = "2024-07-09",
            testPlanEndTime = "2024-07-09"
        ))
    }

    @Test
    fun statisticMachineryInfo() {
        zhgdMachineryInfoService?.statisticMachineryInfo()?.let { println(it) }
    }

    @Test
    fun getMachineryTableInfo() {
        zhgdMachineryInfoService?.getMachineryTableInfo()?.let { println(it) }
    }
}